#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Main file for the mapparser magic'''
from PyQt4 import QtGui
import sys
import argparse
from map_to_xml.map_convertor import supportedMapTypes, convert_map_to_xml
from xml_to_py.cc_xml_parser import parseXML
from UI.MP_mainwindow import MP_MainWindow

def main():
    '''Main function'''
    parser = argparse.ArgumentParser(description='Mapparser')
    parser.add_argument('gcc_mapfile', help='GCC mapfile')
    #parser.add_argument('diab_mapfile', help='DIAB mapfile')
    args = parser.parse_args()

    print(supportedMapTypes())

    convert_map_to_xml(args.gcc_mapfile, 'lala.xml', 'GCC')
    parseXML('lala.xml')
    #parse_gcc( args.gcc_mapfile , 'lala.xml')

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    MainMainWindow = QtGui.QMainWindow()
    ui = MP_MainWindow()
    ui.setupUi(MainMainWindow)
    MainMainWindow.show()
    sys.exit(app.exec_())
